#include <math.h>
#include <iostream>
#include <conio.h>

double f1(double x2, double x3)
{
	return (-1.5*x2 - 2.6*x3) / -9.9;
}

double f2(double x1, double x3)
{
	return (2.5*x1 - 0.5*x3 - 3.5) / -5.8;
}

double f3(double x1, double x2)
{
	return (0.7*x1 + 0.4*x2 + 1.3) / -7.1;
}

int main(int argc, char argv[])
{
	double epsilon = 0.0001;	

	double x1 = 0.0;
	double x2 = 0.0;
	double x3 = 0.0;

	while(fabs(f1(x2, x3) - x1) > epsilon 
		||	fabs(f2(x1, x3) - x2) > epsilon
		|| 	fabs(f3(x1, x2) - x3) > epsilon
		)
	{
		x1 = f1(x2, x3);
		x2 = f2(x1, x3);
		x3 = f3(x1, x2);
	}

	std::cout << "Resultat: x1 = " << x1 << "  x2 = " << x2 << "  x3 = " << x3;

	getch();

	return 0;
}